package com.longdaji.decoration.di.module;


import com.longdaji.decoration.di.scope.ActivityScoped;
import com.longdaji.decoration.di.scope.FragmentScoped;
import com.longdaji.decoration.ui.main.MainContract;
import com.longdaji.decoration.ui.main.MainPresenter;
import com.longdaji.decoration.ui.main.cart.CartContract;
import com.longdaji.decoration.ui.main.cart.CartFragment;
import com.longdaji.decoration.ui.main.cart.CartPresenter;
import com.longdaji.decoration.ui.main.community.CommunityFragment;
import com.longdaji.decoration.ui.main.home.HomeContract;
import com.longdaji.decoration.ui.main.home.HomeFragment;
import com.longdaji.decoration.ui.main.home.HomePresenter;
import com.longdaji.decoration.ui.main.community.CommunityContract;
import com.longdaji.decoration.ui.main.community.CommunityFragment;
import com.longdaji.decoration.ui.main.community.CommunityPresenter;
import com.longdaji.decoration.ui.main.community.innerFragment.DynamicFragment;
import com.longdaji.decoration.ui.main.community.innerFragment.FollowFragment;
import com.longdaji.decoration.ui.main.home.HomeFragment;
import com.longdaji.decoration.ui.main.mine.MineContract;
import com.longdaji.decoration.ui.main.mine.MineFragment;
import com.longdaji.decoration.ui.main.mine.MinePresenter;

import dagger.Binds;
import dagger.Module;
import dagger.android.ContributesAndroidInjector;

/**
 * Created by longtao on 2017/12/26.
 */
@Module
public abstract class MainModule {
    @FragmentScoped
    @ContributesAndroidInjector
    abstract HomeFragment homeFragment();

    @FragmentScoped
    @ContributesAndroidInjector
    abstract CommunityFragment communityFragment();

    @FragmentScoped
    @ContributesAndroidInjector
    abstract CartFragment cartFragment();

    @FragmentScoped
    @ContributesAndroidInjector
    abstract MineFragment mineFragment();

    @ActivityScoped
    @Binds
    abstract MainContract.Presenter mainPresenter(MainPresenter presenter);

    @ActivityScoped
    @Binds
    abstract HomeContract.Presenter homePresenter(HomePresenter presenter);

    @ActivityScoped
    @Binds
    abstract CartContract.Presenter cartPresenter(CartPresenter presenter);

    @FragmentScoped
    @ContributesAndroidInjector
    abstract DynamicFragment dynamicFragment();

    @FragmentScoped
    @ContributesAndroidInjector
    abstract FollowFragment followFragment();

    @ActivityScoped
    @Binds
    abstract CommunityContract.Presenter communityPresenter(CommunityPresenter presenter);

    @ActivityScoped
    @Binds
    abstract MineContract.Presenter minePresenter(MinePresenter presenter);


}
